<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			window.onload = function(){
				var createBtn = document.getElementsByTagName('input')[0];
				createBtn.onclick = function(){
					var oBox = document.createElement('div');
					oBox.setAttribute('id','box');
					var nameInput = document.createElement('input');
					nameInput.setAttribute('type','text');
					nameInput.setAttribute('value','老周');
					
					var pwdInput = document.createElement('input');
					pwdInput.setAttribute('type','password');
					pwdInput.setAttribute('name','password');
					
					var btnInput = document.createElement('input');
					btnInput.setAttribute('type','button');
					btnInput.setAttribute('value','提交');
					
					oBox.appendChild(nameInput);
					oBox.appendChild(pwdInput);
					oBox.appendChild(btnInput);
					document.body.appendChild(oBox);
				}				
				
				
			}
		</script>
	</head>
	<body>
		<input type="button" value="创建表单" />
	</body>
</html>
